# 需要的cmake最低版本是 2.8
cmake_minimum_required(VERSION 2.8)

project(WServer)

#set(CMAKE_CXX_FLAGS "-std=c++11" )
#add_definitions("-Wall -std=c++11") # <= 新增的编译选项

set(SRC_LIST
  ${PROJECT_SOURCE_DIR}/src/main.cpp
  ${PROJECT_SOURCE_DIR}/src/sserver.cpp
  ${PROJECT_SOURCE_DIR}/src/common.h
  ${PROJECT_SOURCE_DIR}/src/sserver.h
  ${PROJECT_SOURCE_DIR}/src/EpollHandle.h
  ${PROJECT_SOURCE_DIR}/src/EpollHandle.cpp
  ${PROJECT_SOURCE_DIR}/src/Socket.cpp
  ${PROJECT_SOURCE_DIR}/src/Socket.h
  ${PROJECT_SOURCE_DIR}/src/CinUserMap.cpp
  ${PROJECT_SOURCE_DIR}/src/CinUserMap.h  
  )

aux_source_directory(. ALL_SRCS)

add_subdirectory(${PROJET_SOURCE_DIR}/src/bean)	
add_subdirectory(${PROJET_SOURCE_DIR}/src/business)	

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

add_executable(wserver ${SRC_LIST} Threads)